<?php

$params = call_user_func_array(['yii\helpers\ArrayHelper', 'merge'], [
    require __DIR__ . '/../../../common/config/params.php',
    require __DIR__ . '/../../../common/config/params-local.php',
    require __DIR__ . '/params.php',
    require __DIR__ . '/params-local.php'
]);

$appendName = basename(dirname(__DIR__));

return [
    'id' => 'amc-' . $appendName,
    'name' => '数字鲸鱼在线平台',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'apiend\controllers',
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-' . $appendName,
            'parsers' => [
                'application/json' => 'yii\web\JsonParser',
            ],
            'trustedHosts' => [
                '192.168.0.0/24'
            ],
        ],
        'authManager' => [
            'class' => 'youmbe\rbac\components\DbManager', //配置文件
        ],
        'user' => [
            'identityClass' => 'apiend\models\User',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<module>/<controller:\w+>/<id:\d+>' => '<module>/<controller>/view',
            ],
        ],
        'assetManager' => [
            'bundles' => [
                'yii\gii\GiiAsset' => [
                    'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
                ],
            ]
        ]
    ],
    'modules' => require(__DIR__ . '/modules.php'),
    'params' => $params,
];
